package com.tuanzi.loan.business.service.common.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tuanzi.loan.business.entity.common.UserInstall;
import com.tuanzi.loan.business.repository.common.UserInstallRepository;
import com.tuanzi.loan.business.service.common.UserInstallService;
import com.tuanzi.loan.core.aspect.Debug;

/**
 * @author Ray 2017/10/31
 */
@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class UserInstallServiceImpl implements UserInstallService {

	@Autowired
	private UserInstallRepository userInstallRepository;

	@Override
	public List<UserInstall> findAllByPhoneId(String phoneId) {
		return userInstallRepository.findAllByPhoneId(phoneId);
	}

	@Override
	public List<UserInstall> findAllByPhoneIds(List<String> phoneIds) {
		return userInstallRepository.findAllByPhoneIdIn(phoneIds);
	}

	@Override
	public Long countByPhoneIdAndPackageSrc(String phoneId, String packageSrc) {
		return null;
	}
}
